<div class="points">
    <div class="nav">
        <div class="nav-li focus">推荐返利</div>
        <a href="#admin/shoppinguide">
            <div class="nav-li">员工提成</div>
        </a>
    </div>

    <hr />

    <div class="box">
    	<h4>推荐返利用于自发分享的用户推广</h4>
        <table>
            <thead>
                <td class="money"></td>
                <td class="money">累积订单金额</td>
                <td class="mod">返比(0.01~0.99)</td>
                <td class="mod">购买者享受折扣</td>
                <td class="metdod">操作</th>
            </thead>
            {{#each $Cache.bus.recommend_config}}

            <tr>
                <td>{{~~$Index+1}}级规则</td>
                {{#if $Private.is_updatting}}
                <td>
                    <input bind-input="{{'max_price'}}" value="{{#Fixed max_price}}" />
                </td>
                <td>
                    <inputnumber min="0" max="100" fixed="2" event-change="{{'$Top.$Event.recommend_config.rate_m_100'}}" value="{{rate*100}}"></inputnumber>%
                </td>
                <td>
                    <inputnumber min="0" max="100" fixed="2" event-change="{{'$Top.$Event.recommend_config.disc_rate_m_100'}}" value="{{disc_rate*100}}"></inputnumber>%
                </td>
                {{#else}}
                <td>{{#Fixed max_price}}</td>
                <td>{{#Fixed rate*100}}%</td>
                <td>{{#Fixed disc_rate*100}}%</td>
                {{/if}}
                <td>
                    <button event-click="{{'$Top.$Event.recommend_config.update'}}">
                    {{$Private.is_updatting?'完成':'修改'}}
                    </button>
                    <button event-click="{{'$Top.$Event.recommend_config.remove'}}">删除</button>
                </td>
            </tr>

            {{/each}}


            <tr>
                <td>添加新的规则</td>
                <td>
                    <input bind-input="{{'$Cache.new_recommend_config.max_price'}}" value="{{$Cache.new_recommend_config.max_price}}" type="text" />
                </td>
                <td>
                    <inputnumber min="0" max="100" fixed="2" event-change="{{'$Event.new_recommend_config.rate_m_100'}}" value="{{$Cache.new_recommend_config.rate*100}}"></inputnumber>%
                </td>
                <td>
                    <inputnumber min="0" max="100" fixed="2" event-change="{{'$Event.new_recommend_config.disc_rate_m_100'}}" value="{{$Cache.new_recommend_config.disc_rate*100}}"></inputnumber>%
                </td>
                <td>
                    <button event-click="{{'$Top.$Event.recommend_config.add'}}">添加</button>
                </td>
            </tr>

        </table>
        <table>
            <thead>
                <td class="number">用户名</td>
                <td class="number">手机号/邮箱</td>
                <td class="alipay">支付宝账号</td>
                <td class="price">现有订单金额</td>
                <td class="get">红利分成</td>
                <td class="method">操作</td>
            </thead>
            {{#each $Cache.bus.bus_user_bind}}
            <tr>
                <td>{{user.info.name}}</td>
                <td>{{user.info.mobile_phone||user.info.email}}</td>
                <td>{{#if user.info.alipay}}{{user.info.alipay}}{{#else}}<i>用户未绑定</i>{{/if}}</td>
                <td>{{#Fixed acc}}</td>
                <td>{{#Fixed _money}}</td>
                <td>
                    <!-- {{#if state==$Top.config.bus_user_bind_status.weishenqingduihuan}}
                    <div class="info">用户并未申请兑换</div>
                    {{/if}} {{#if state==$Top.config.bus_user_bind_status.shenqingduihuanzhong}}
                    <div class="info">用户请求兑换，请将金额转到用户账上</div>
                    <input type="button" event-click="{{'$Top.$Event.bus.shenqingduihuanzhong_to_shangjiayijingfukuan'}}" class="do" name="do" value="转账完成" />
                    {{/if}} {{#if state==$Top.config.bus_user_bind_status.shangjiayijingfukuan}}
                    <div class="info">等待用户确认收款</div>
                    {{/if}} -->
                </td>
            </tr>
            {{/each}}
        </table>
    </div>
</div>
